import Vue from 'vue'
import Router from 'vue-router'

import Login from './views/login'
import NotFound from './views/404.vue';
import Index from './views/index'
import Home from './views/home/home'


Vue.use(Router);

let routers = [
    { path: '/404', component: NotFound , name: '404', hidden: true },
    // { path: '*', hidden: true, redirect: { path: '/404' } },
    { path: '/', hidden: true, redirect: { path: '/home' } },
    { path: '/login', name: '登录', component: Login},
    { path: '/test', name: 'test',
        component: () => import('./views/test.vue')
    },

    {
        path: '/redirect',
        component: Index,
        hidden: true,
        children: [
            {
                path: '/redirect/:path*',
                component: () => import('@/views/redirect/index')
            }
        ]
    },

    {
        path: '/home', name: '', component: Index, iconCls: 'el-icon-message', leaf: true, icon: 'icon-home', public: true,
        children: [
            {path: '', component: Home, name: '首页', meta: {title: "首页"}},
        ]
    },

    // {
    //     path: '/goods',
    //     name: '商品管理',
    //     component: Index,
    //     iconCls: 'el-icon-message',
    //     left: true,
    //     icon: 'icon-goods',
    //     public: true,
    //     children: [
    //         { path: 'list', component: () => import("./views/goods/goods-list.vue"), name: '商品列表', meta: {title: "商品列表"}},
    //         { path: 'goods-spec-list', component: () => import("./views/goods/goods-spec-list.vue"), name: '商品规格设置', meta: {title: "商品规格设置"}, hidden: true},
    //     ]
    // },

    // {
    //     path: '/order',
    //     name: '订单管理',
    //     component: Index,
    //     iconCls: 'el-icon-message',
    //     left: true,
    //     icon: 'icon-order',
    //     public: true,
    //     children: [
    //         { path: 'list', component: () => import("./views/order/order-list.vue"), name: '订单列表', meta: {title: "订单列表"}},
    //         { path: 'detail', component: () => import("./views/order/order-detail.vue"), name: '订单详情', meta: {title: "订单详情"}, hidden: true},
    //         { path: 'evaluation-list', component: () => import("./views/order/order-evaluation-list.vue"), name: '订单评价', meta: {title: "订单评价"}},
    //     ]
    // },

    {
        path: '/user',
        name: '用户管理',
        component: Index,
        iconCls: 'el-icon-message',
        left: true,
        icon: 'icon-user',
        public: true,
        children: [
            // { path: 'doctor-list', component: () => import("./views/user/doctor-list.vue"), name: '医生列表', meta: {title: "医生列表"}},
            { path: 'ds-user-list', component: () => import("./views/user/ds-user-list.vue"), name: '我的经销商', meta: {title: "我的经销商列表"}},
            { path: 'goods-sharing', component: () => import("./views/user/goods-sharing.vue"), name: '销售配置', meta: {title: "销售配置"}, hidden: true},
        ]
    },


];

export default new Router({
    routes: routers
})
